/*
 * @Author: 蔡钦成,李栋骋
 * @Company: USST
 * @File:restaurant.h
 * @Description: 点餐系统的设计与实现
 * coded by "utf-8"
 */
/*include*/
#ifndef _GLIBCXX_NO_ASSERT
#include <assert.h>
#endif
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/*c11*/
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdalign.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <wchar.h>
#include <wctype.h>
/*windows*/
#define WIN32_LEAN_AND_MEAN
#include <conio.h>
#include <malloc.h>
#include <memory.h>
#include <stdlib.h>
#include <tchar.h>
#include <windows.h>
/*define*/
#define mian main
#define ture true
#define flase false
#define whlie while
#define viod void
#define stido stdio
#define studo stdio
#define elif else if
#define println printf
#define write fprintf
#define dfiene define
#define difine define
#define studio stdio
#define man() main()
#define paintf printf
#define ll long long
#define Printf printf
#define N 1000 /*定义总菜品至多100种 \
/*typedef/structs*/
/*struct __Dish p;与dish p;作用相同*/
typedef struct __PopularDish
{
    char name[100];
    int num;
}populardish;
typedef struct __Dish
{
    /*单个菜品*/
    char name[100];
    float cost;       /*成本*/
    char type[10];    /*种类：凉菜，荤菜，素菜，汤，面点，……*/
    float price;      /*价格*/
    int daily_supply; /*日供量*/
} dish;
typedef struct __Table
{
    char id[10];  /*桌号*/
    int capacity; /*容量，几人桌*/
    _Bool free;   /*是否被占用1为空*/
} table;
typedef struct __Customers
{
    int num;          /*几个人*/
    dish list[20];    /*点了啥菜*/
    int dish_num[20]; /*点了多少*/
    int size;         /*菜的种数*/
    table *_table;    /*坐在哪桌*/
    float price;      /*价格*/
    struct __Customers *next;
} customer;
typedef struct __Dividedlist
{
    char *type[20];         /*菜种列表*/
    dish lists[20][N / 10]; /*分好的各表*/
    int type_num;
    int list_num[20];
} divided_lists;
/*functions*/
void HideCursor();
void ui();
void ui_sign_in();
void ui_set_password();
char getkeyboard();
int load_dish(dish list[]);
int load_table(table list[]);
void sort_dish_price_down(dish list[], int n);
void sort_dish_price_up(dish list[], int n);
void sort_dish_name(dish list[], int n);
void sort_dish_type(dish list[], int n);
void print_dish(dish list[], int n);
customer *new_customer();
customer *find_customer(char *id, customer *head);
customer *del_customer(char *id, customer *head);
void unpaid_customer(customer *head);
void bill(customer *c);
void myexit();
void add_to_menu(dish cai);
divided_lists divide(dish full_list[], int dish_num);
void sort_table(table list[], int n);
void popular(customer *customers,int customers_num);
#include "add.h"
#include "customer.h"
#include "divide.h"
#include "exit.h"
#include "getkeyboard.h"
#include "hidecursor.h"
#include "load_dish.h"
#include "load_table.h"
#include "password.h"
#include "print_dish.h"
#include "sort_dish_name.h"
#include "sort_dish_price_down.h"
#include "sort_dish_price_up.h"
#include "sort_dish_type.h"
#include "sort_table.h"
#include "ui.h"
#include "popular.h"